//
//  UILabel+BPBoundingRect.m
//  BabyPhotograph
//
//  Created by cesh on 2017/3/15.
//  Copyright © 2017年 cesh. All rights reserved.
//

#import "UILabel+BPBoundingRect.h"

@implementation UILabel (BPBoundingRect)

-(CGRect)boundingRectWithInitSize:(CGSize)size
{
    
    self.lineBreakMode=NSLineBreakByWordWrapping;
    
    CGRect rect=[self.text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObjectsAndKeys:self.font,NSFontAttributeName, nil] context:nil];
    
    return rect;
}

@end
